<!--
 * @Author: sxb
 * @Email: sxb@mail.com
 * @Date: 2020-11-30 17:26:09
 * @Descripttion: 
-->
<template>
  <div>
    <avue-crud
      ref="crud"
      :option="tableOption"
      :data="list"
      :table-loading="listLoading"
      @on-load="getList"
      @refresh-change="refreshChange"
    >
      <template slot="CheckImgUrls" slot-scope="scope">
        <img :src="imgsUrl+scope.row.CheckImgUrls" alt style="width:100%;height:auto;" />
      </template>
    </avue-crud>
  </div>
</template>

<script>
import setting from "@/setting";
import { operateRecordApi } from "@/api/platProduct/management";
import { tableOption } from "@/const/crud/platProduct/product-operateRecordList";
export default {
  name: "operateRecord",
  data() {
    return {
      imgsUrl: setting.apiUrl,
      tableOption: tableOption,
      list: [],
      listLoading: false,
    };
  },
  props: {
    Id: {
      type: String,
      default: "",
      required: true,
    },
  },
  watch: {
    Id(newValue, oldValue) {
      if (newValue) {
        this.list = [];
        this.getList();
      }
    },
  },
  methods: {
    getList() {
      this.listLoading = true;
      operateRecordApi({
        Id: this.Id,
      })
        .then((res) => {
          if (res.status == 200) {
            if (res.data.code == 0) {
              this.list = res.data.data;
              this.listLoading = false;
            }
          }
        })
        .catch((error) => {
          console.log(error);
          this.listLoading = false;
        });
    },
    refreshChange() {
      this.getList();
    },
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
</style>